// orderDetail.js
var tagId =0
Page({

  /**
   * 页面的初始数据
   */
  data: {
    
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
      var that = this;
      tagId = options.tagid;
      console.log(tagId)
      if(tagId == 1){
        that.setVisiable(true, true)
        that.setText('立即支付')
      }else if(tagId == 2){
        that.setVisiable(false,false)
      }else if(tagId == 3){
        that.setVisiable(true,false)
        that.setText('服务完成')
      } else if (tagId == 4) {
        that.setVisiable(true, false)
        that.setText("我要评价")
      } else if (tagId == 5) {
        that.setVisiable(true, false)
        that.setText("再来一单")
      }
  },

  /**
   * 设置btn的显示隐藏
   */
  setVisiable:function(payment,cancel){
    var that = this;
    that.setData({
      payment: payment,
      cancel: cancel
    })
  },

  /**
   * 设置btn的text
   */
  setText:function(value){
    var that = this;
    that.setData({
      btnOneText:value
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  },

  btnPayment:function(){
     if(tagId == 1){

     } else if (tagId == 3) {
        wx.navigateTo({
          url: '../../pages/comment/comment',
        })
     } else if (tagId == 4) {

     } else if (tagId == 5) {

     }
  },

  /**
   * 取消按钮
   */
  btnCancel:function(){

  }
})